﻿using MahApps.Metro.IconPacks;
using System;
using System.Globalization;
using System.Windows.Data;

namespace PLCWpfTest.Converters
{
    public class IntToIconTypeConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
            {
                throw new ArgumentNullException("Value can not be null");
            }
            PackIconMaterialDesignKind kind;
            switch ((int)value)
            {
                case 0:
                default:
                    kind = PackIconMaterialDesignKind.Info;
                    break;
                case 1:
                    kind = PackIconMaterialDesignKind.Warning;
                    break;
                case 2:
                    kind = PackIconMaterialDesignKind.Error;
                    break;
            }
            return kind;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return null;
        }
    }
}
